import { createRouter, createWebHistory } from 'vue-router'

import Login from '@/views/Login.vue'
import Register from '@/views/Register.vue'
import Index from '@/views/Index.vue'
import Appointment from '@/views/Appointment.vue'
import Hospital from '@/views/Hospital.vue'
import Setmeal from '@/views/Setmeal.vue'
import Selectdate from '@/views/Selectdate.vue'
import ConfirmOrder from '@/views/ConfirmOrder.vue'
import Personal from '@/views/Personal.vue'
import ReportList from '@/views/ReportList.vue'
import Report from '@/views/Report.vue'
import AppointmentCancel from '@/views/AppointmentCancel.vue'
import AppointmentList from '@/views/AppointmentList.vue'
import AppointmentSuccess from '@/views/AppointmentSuccess.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Login,
    },
    {
      path: '/appointment',
      name: 'appointment',
      component: Appointment,
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/index',
      name: 'index',
      component: Index,
    },
    {
      path: '/hospital',
      name: 'hospital',
      component: Hospital,
    },
    {
      path: '/setmeal',
      name: 'setmeal',
      component: Setmeal,
    },
    {
      path: '/selectdate',
      name: 'selectdate',
      component: Selectdate,
    },
    {
      path: '/confirmOrder',
      name: 'confirmOrder',
      component: ConfirmOrder,
    },
    {
      path: '/personal',
      name: 'personal',
      component: Personal,
    },
    {
      path: '/reportList',
      name: 'reportList',
      component: ReportList,
    },
    {
      path: '/report',
      name: 'report',
      component: Report,
    },
    {
      path: '/appointmentList',
      name: 'appointmentList',
      component: AppointmentList,
    },
    {
      path: '/appointmentSuccess',
      name: 'appointmentSuccess',
      component: AppointmentSuccess,
    },
    {
      path: '/appointmentCancel',
      name: 'appointmentCancel',
      component: AppointmentCancel,
    },
    {
      path: '/first',
      name: 'first',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/First.vue'),
    },
  ],
})

export default router
